/**
 * @description 组件样式
 * @author: 陈陈
 * @date: 2025/05/09
 * @phone: 18560000860
 * @email: 18560000860@qq.com
 * @company: 济南晨霜信息技术有限公司 /
 * @business: 承接前后端项目的开发
 */
.pure-search {
	display: flex;
	flex-direction: row;
	align-items: center;
	border-radius: var(--pure-search-border-radius, var(--pure-radius-round));
	height: var(--pure-search-height, 3em);
	gap: var(--pure-search-gap, 6px);
	background: var(--pure-search-background, var(--pure-background-default));
	padding: var(--pure-search-padding, 0 12px);
	width: 100%;

	&__icon {
		flex-shrink: 0;
		font-size: var(--pure-search-icon-font-size, var(--pure-font-size-big));
		font-weight: var(--pure-search-icon-font-weight, 500);
		color: var(--pure-search-icon-color, var(--pure-text-color-regular));
		margin: var(--pure-search-icon-margin);
		padding: var(--pure-search-icon-padding);
	}

	&__body {
		flex: 1;
		height: 100%;
		position: relative;
		padding: var(--pure-search-body-padding);
	}

	&__placeholder {
		width: 100%;
		height: 100%;
		color: var(--pure-search-placeholder-color, var(--pure-text-color-placeholder));
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 0;
		transform: opacity 0.3s ease-in-out;

		&__item {
			display: flex;
			flex-direction: row;
			align-items: center;
		}

		&--hide {
			opacity: 0;
		}
	}

	&__input {
		width: 100%;
		height: 100%;
		border: none;
		outline: none;
		font-size: inherit;
		background: transparent;
	}

	&__clear {
		font-size: var(--pure-search-clear-font-size, var(--pure-font-size-large));
		font-weight: var(--pure-search-clear-font-weight, 500);
		color: var(--pure-search-clear-color, var(--pure-text-color-regular));
		margin: var(--pure-search-clear-margin);
		padding: var(--pure-search-clear-padding);
		flex-shrink: 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	&__button {
		flex-shrink: 0;
		height: 100%;
		width: var(--pure-search-button-container-width, 5em);
		padding: var(--pure-search-button-container-padding, 4px 0);
		margin: var(--pure-search-button-container-margin, 0 -8px 0 0);
		font-size: var(--pure-search-button-font-size);
		font-weight: var(--pure-search-button-font-weight);
		color: var(--pure-search-button-color);
		--pure-button-height: 100%;
		--pure-button-width: 100%;
	}

	// 禁用
	&--disabled {
		pointer-events: none;
		user-select: none;
		opacity: var(--pure-search-disabled-opacity, var(--pure-opacity-disabled));
	}

	&--link-button {
		.pure-search__button {
			width: var(--pure-search-button-container-width, auto);
			font-weight: var(--pure-search-button-font-weight, 500);
			margin: var(--pure-search-button-container-margin, 0 2px 0 0);
		}
	}

	// 只读
	&--readonly {
		position: relative;

		.pure-search__body,
		.pure-search__input,
		.pure-search__clear,
		.pure-search__button {
			pointer-events: none;
			user-select: none;
		}

		&::before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			z-index: 6;
		}
	}
}
